<template>
  <div>
    <B>用户管理</B>
    <User :user_item="userItem" id="userInfo"></User>
    <div align="left">
    <input type="button" value="参数测试" v-on:click="read_params()"/>
    <input type="button" value="返回上一页（HellpWorld）" v-on:click="back()"/></div>
  </div>
</template>

<script>
  import User from './user'

  export default {
    name: 'UserManage',
    components: {User},
    data () {
      return {
        userItem: {
          no: 'a1',
          name: 'b1',
          cname: this.$route.params.cname
        }
      }
    },
    methods: {
      back: function () {
        this.$router.back()
      },
      read_params: function() {
        alert( this.userItem.no);
        var text = "";
        for (var i in this.$route.params) {
          text = text + i + ":" + this.$route.params[i] + "\r\n";
        }
        alert(text);
        this.userItem.no=this.$route.params.no;
        this.userItem.name=this.$route.params.name;
        this.userItem.cname=this.$route.params.cname;
      }
    },
    mounted: function () {
    }
  }
</script>

<style scoped>

</style>
